#pragma once
#include <iostream>
#include <string>
#include <unistd.h>
using namespace std;
enum
{
    ok = 0,
    div_zero,
    mod_zero,
    unknow,
};
const string operachar = "+-*/%&()";

class Task
{
    public:
        Task(int a, int b, char op) : datea(a), dateb(b), oper(op),result(0), code(ok)
    {
        
    }
    Task()
    {
    }
    void Run()
    {
        switch (oper)
        {
        case '+':
            result = datea + dateb;
            break;
        case '-':
            result = datea - dateb;
            break;
        case '*':
            result = datea * dateb;
            break;
        case '/':
        {
            if (datea == 0)
                code = div_zero;
            else
                result = datea / dateb;
        }
        break;
        case '%':
        {
            if (datea == 0)
                code = mod_zero;
            else
                result = datea % dateb;
        }
        break;
        default:
            code = unknow;
            break;
        }
    }
    void operator()()
    {
        Run();
        sleep(2);
    }
    void prdduct()
    {
     cout<<datea<<oper<<dateb<<"="<<"?"<<endl;
    }
    void custom()
    {
      cout<<datea<<oper<<dateb<<"="<<result<<endl;
    }
    ~Task()
    {
    }

private:
    int datea;
    int dateb;
    char oper;
    int result;
    int code;
};